home *** CD-ROM | disk | FTP | other *** search
/ PCMania 21 / PCMania CD21.nrg / pcmania / raton / sinfo.c < prev    next >
C/C++ Source or Header  |  1994-02-28  |  2KB  |  86 lines

  1. #include <stdio.h>
  2. #include <conio.h>
  3.  
  4. void main(void);
  5. void chkcom(void);
  6. void prttit(void);
  7. void prtports(void);
  8.  
  9. int com1,com2,com3,com4;
  10.  
  11. void main(void)
  12. {
  13. chkcom();
  14. prttit();
  15. prtports();
  16. }
  17.  
  18. void prtports(void)
  19. {
  20. int x,v;
  21.  
  22. textbackground(BLUE); textcolor(YELLOW);
  23. for (x=9;x<13;x++) {    gotoxy(23,x);
  24.             for (v=5;v<37;v++) { cprintf(" "); }
  25.             cprintf("\n");
  26.            }
  27. gotoxy(22,8); cprintf("╔");
  28. for (v=0;v<31;v++) { cprintf("═"); } cprintf("╗");
  29. gotoxy(22,13); cprintf("╚");
  30. for (v=0;v<31;v++) { cprintf("═"); } cprintf("╝");
  31. for (v=1;v<5;v++) { gotoxy(22,v+8); cprintf("║"); }
  32. for (v=1;v<5;v++) { gotoxy(54,v+8); cprintf("║"); }
  33.  
  34. gotoxy(23,9); textbackground(BLUE); textcolor(YELLOW);
  35. cprintf("Puerto Serie COM1: "); textcolor(WHITE);
  36.     if (com1==0) cprintf("No instalado");
  37.        else cprintf("%04X",com1);
  38. textcolor(YELLOW); gotoxy(23,10);
  39. cprintf("Puerto Serie COM2: "); textcolor(WHITE);
  40.     if (com2==0) cprintf("No instalado");
  41.        else cprintf("%04X",com2);
  42. textcolor(YELLOW); gotoxy(23,11);
  43. cprintf("Puerto Serie COM3: "); textcolor(WHITE);
  44.     if (com3==0) cprintf("No instalado");
  45.        else cprintf("%04X",com3);
  46. textcolor(YELLOW); gotoxy(23,12);
  47. cprintf("Puerto Serie COM4: "); textcolor(WHITE);
  48.     if (com4==0) cprintf("No instalado");
  49.        else cprintf("%04X",com4);
  50. textcolor(YELLOW);
  51. }
  52.  
  53. void prttit(void)
  54. {
  55. clrscr();
  56. window(20,1,60,6);
  57. gotoxy(1,1);
  58. textbackground(BLUE);
  59. textcolor(YELLOW);
  60. cprintf("╔═══════════════════════════════════════╗");
  61. cprintf("║             SERIAL INFO               ║");
  62. cprintf("║     (C) Por Javier Guerrero Diaz      ║");
  63. cprintf("╚═══════════════════════════════════════╝");
  64. window(1,1,80,25);
  65. }
  66.  
  67. void chkcom(void)
  68. {
  69. asm    push    es
  70. asm    push    di
  71. asm    mov    ax,0040h
  72. asm    xor    bx,bx
  73. asm    mov    es,ax
  74. asm    mov    di,bx
  75. asm    mov    ax,es:[di]
  76. asm    mov    com1,ax
  77. asm    mov    ax,es:[di+2]
  78. asm    mov    com2,ax
  79. asm    mov    ax,es:[di+4]
  80. asm    mov    com3,ax
  81. asm    mov    ax,es:[di+6]
  82. asm    mov    com4,ax
  83. asm    pop    di
  84. asm    pop    es
  85. }
  86.